package com.cloud.code.datetime;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SimpleDateTest {

    public static void main(String[] args) throws ParseException {

        ExecutorService executorService = Executors.newFixedThreadPool(10);

        while (true){
            executorService.execute(()->{
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                String format = simpleDateFormat.format(new Date());

                try {
                    Date parse = simpleDateFormat.parse(format);
                } catch (ParseException e) {
                    e.printStackTrace();
                }
            });
        }
    }
}
